package eerbaar.v2.pattern.server;

import java.io.IOException;

import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import eerbaar.shared.service.ServiceFactory;

public class InitServlet implements Servlet {

    private ServletConfig config;

    public InitServlet() {
        //
    }

    @Override
    public void destroy() {
        //
    }

    @Override
    public ServletConfig getServletConfig() {
        return this.config;
    }

    @Override
    public String getServletInfo() {
        return "InitServlet";
    }

    @Override
    public void init(ServletConfig config) throws ServletException {

        ServiceFactory.register(IProgramGeneratorFactory.class,
                new ProgramGeneratorFactory());

        this.config = config;
    }

    @Override
    public void service(ServletRequest arg0, ServletResponse arg1)
            throws ServletException, IOException {
        //
    }

}
